package cn.crce.cloud9.basic;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月10日 上午 12:21
 */
public class Case41 {
    public static void main(String[] args) {
        //**********found**********
        char[] arrayOfChars = { 'A', 'B', 'A','D', 'E','F','G' };
        char searchfor = 'A';

        int i=0, j=0;
        //**********found**********
        while ( i < arrayOfChars.length) {
            if (arrayOfChars[i] == searchfor) {
                System.out.println("Found " + searchfor + " at index " + i);
                j++;
            }
            //**********found**********
            i++ ;
        }
        //**********found**********
        if (j > 0) {
            System.out.println("The total amount of " + searchfor + " is " + j );
        } else {
            System.out.println(searchfor + " is not in the array");
        }
    }
}
